using System;
using System.Web.UI;
using System.Web.UI.Adapters;
using System.Web.UI.HtmlControls;

namespace MyWebPagesStarterKit.Adapters
{
    public class HtmlHeadAdapter : ControlAdapter
    {
        protected override void Render(HtmlTextWriter writer)
        {
            writer.WriteLine("<head>");
            writer.Write("\t<title>" + base.Page.Title + "</title>\n");
            HtmlHead control = (HtmlHead) base.Control;
            ControlCollection controls = control.Controls;
            for (int i = 0; i < controls.Count; i++)
            {
                Control control1 = controls[i];
                control.Controls[i].RenderControl(writer);
            }
            writer.Write("</head>");
        }
    }
}
